<template>
  <div>
    <el-button @click="batchDownload">批量下载</el-button>
    <el-table
      :data="StudentWorkhomeList"
      :stripe="true"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="编号">
      </el-table-column>
      <el-table-column
        label="学生姓名">
        <template slot-scope="scope">
          {{scope.row.student.name}}
        </template>
      </el-table-column>
      <el-table-column
        prop="studentDescription"
        label="作业描述">
      </el-table-column>

      <el-table-column
        prop="upDate"
        label="上传时间">
      </el-table-column>
      <el-table-column
        prop="score"
        label="分数">
      </el-table-column>
      <el-table-column
        prop="teacherDescription"
        label="批改描述">
      </el-table-column>
      <el-table-column
        label="操作">
        <template slot-scope="scope">
          <router-link :to="'/studentWorkhome/CheckStudentWorkhome?swid='+scope.row.id+'&wid='+scope.row.wid">
            <el-button size="mini">批改</el-button>
          </router-link>
        </template>
      </el-table-column>
    </el-table>
    <router-view/>
  </div>
</template>

<script>
    export default {
        name: "StudentWorkhomeList",
      data(){
          return {
            StudentWorkhomeList:[]
          }
      },
      created(){
        this.selectAll();
      },
      methods: {
        selectAll(){
          this.axios.get("/studentWorkhome/selectByWorkhome/"+this.$route.query.wid).then((resp)=>{
            this.StudentWorkhomeList=resp.data;
          });
        },
        batchDownload(){
          location.href="http://localhost:8989/studentWorkhome/batchDownload/"+this.$route.query.wid;
        }
      }
    }
</script>

<style scoped>

</style>
